package com.olinsports.system.olinsportssystem.repository;

import com.olinsports.system.olinsportssystem.model.SiteReservation;
import com.olinsports.system.olinsportssystem.model.SiteType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

import java.sql.Date;
import java.util.List;

/**
 * Created by Administrator on 2017/7/23.
 */
@Mapper
@CacheConfig(cacheNames = "siteRev")
public interface SiteReservationRepository {
    @Cacheable
    public List<SiteReservation> selectAll();

    @Cacheable
    public int insertAll(SiteReservation siteReservation);

    @Cacheable
    public int updateData(SiteReservation siteReservation);

    @Cacheable
    public int deleteByKey(int revKey);
    @Cacheable
    public int findCount();

    @Cacheable
    public List<SiteReservation> findLimit(@Param("sord") String sord, @Param("sidx") String sidx, @Param("beg") int beg, @Param("end") int end);

    @Cacheable
    public int selectSelfCount(@Param("field") String field,@Param("fieldValue") String fieldValue);

    @Cacheable
    public List<SiteReservation> selectSelfLimit(@Param("field") String field,@Param("fieldValue") String fieldValue,@Param("beg") int beg, @Param("end") int end);

    @Cacheable
    public List<SiteReservation> selectByScheduledDate(String scheduledDate);
    @Cacheable
    public List<SiteReservation> selectByDateNull();

    @Cacheable
    public SiteReservation selectCheck(@Param("scheduledDate") String scheduledDate, @Param("placeKey") int placeKey, @Param("timeKey") int timeKey);

    @Cacheable
    public int updatePayData(SiteReservation siteReservation);

    @Cacheable
    public List<SiteReservation> selectByMore(@Param("state")String state,@Param("scheduledDate") String scheduledDate,@Param("placeKey") int placeKey,@Param("vipNum") String vipNum);

    @Cacheable
    public List<SiteReservation> selectByState1(@Param("state")String state,@Param("scheduledDate") String scheduledDate,@Param("placeKey") int placeKey,@Param("vipNum") String vipNum);
}
